package com.project.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.project.bean.ProductBean;
import com.project.mapper.IProductMapper;
import com.project.service.IProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDate;

@Service
@Transactional
public class ProductServiceImpl implements IProductService {
    @Autowired
    private IProductMapper mapper;

    @Override
    public IPage<ProductBean> cutByItem(Integer pageNO, String name, LocalDate startDate, LocalDate endDate) {


        return mapper.cutByItem(new Page(pageNO,4),name,startDate,endDate);
    }

    @Override
    public ProductBean findById(Integer id) {
        return mapper.findById(id);
    }
}
